nethackfandomcom-20200214-history
Source:NetHack 3.1.0/global.h
Below is the full text to global.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.0/global.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)global.h 3.1 92/01/04 */ 2. /* Copyright © Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef GLOBAL_H 6. #define GLOBAL_H 7. 8. #include 9. 10. 11. /*#define BETA /* if a beta-test copy MRS */ 12. #define VERSION "3.1" /* version number. */ 13. 14. /* 15. * Files expected to exist in the playground directory. 16. */ 17. 18. #define RECORD "record" /* a file containing list of topscorers */ 19. #define HELP "help" /* a file containing command descriptions */ 20. #define SHELP "hh" /* abbreviated form of the same */ 21. #define DEBUGHELP "wizhelp" /* a file containing debug mode cmds */ 22. #define RUMORFILE "rumors" /* a file with fortune cookies */ 23. #define ORACLEFILE "oracles" /* a file with oracular information */ 24. #define DATAFILE "data" /* a file giving the meaning of symbols used */ 25. #define CMDHELPFILE "cmdhelp" /* file telling what commands do */ 26. #define HISTORY "history" /* a file giving nethack's history */ 27. #define LICENSE "license" /* file with license information */ 28. #define OPTIONFILE "opthelp" /* a file explaining runtime options */ 29. #define OPTIONS_USED "options" /* compile-time options, for #version */ 30. 31. #define LEV_EXT ".lev" /* extension for special level files */ 32. 33. 34. /* Assorted definitions that may depend on selections in config.h. */ 35. 36. /* 37. * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied 38. * with Microport SysV/AT, which have small symbol tables; 39. * DUMB if needed is defined in CFLAGS 40. */ 41. #ifdef DUMB 42. #ifdef BITFIELDS 43. #undef BITFIELDS 44. #endif 45. #ifndef STUPID 46. #define STUPID 47. #endif 48. #endif /* DUMB */ 49. 50. /* 51. * type xchar: small integers in the range 0 - 127, usually coordinates 52. * although they are nonnegative they must not be declared unsigned 53. * since otherwise comparisons with signed quantities are done incorrectly 54. */ 55. typedef schar xchar; 56. typedef xchar boolean; /* 0 or 1 */ 57. 58. #ifndef TRUE /* defined in some systems' native include files */ 59. #define TRUE ((boolean)1) 60. #define FALSE ((boolean)0) 61. #endif 62. 63. #ifndef STRNCMPI 64. # define strcmpi(a,b) strncmpi((a),(b),-1) 65. #endif 66. 67. /* comment out to test effects of each #define -- these will probably 68. * disappear eventually 69. */ 70. #ifdef INTERNAL_COMP 71. # define RLECOMP /* run-length compression of levl array - JLee */ 72. # define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */ 73. #endif 74. 75. /* #define SPECIALIZATION /* do "specialized" version of new topology */ 76. 77. 78. #ifdef BITFIELDS 79. #define Bitfield(x,n) unsigned x:n 80. #else 81. #define Bitfield(x,n) uchar x 82. #endif 83. 84. #ifdef UNWIDENED_PROTOTYPES 85. # define CHAR_P char 86. # define SCHAR_P schar 87. # define UCHAR_P uchar 88. # define XCHAR_P xchar 89. # define SHORT_P short 90. # define BOOLEAN_P boolean 91. # define ALIGNTYP_P aligntyp 92. #else 93. # ifdef WIDENED_PROTOTYPES 94. # define CHAR_P int 95. # define SCHAR_P int 96. # define UCHAR_P int 97. # define XCHAR_P int 98. # define SHORT_P int 99. # define BOOLEAN_P int 100. # define ALIGNTYP_P int 101. # endif 102. #endif 103. #if defined(ULTRIX_PROTO) && !defined(__GNUC__) 104. /* The ultrix 2.0 and 2.1 compilers (on Ultrix 4.0 and 4.2 respectively) can't 105. * handle "struct obj *" constructs in prototypes. Their bugs are different, 106. * but both seem to work if we put "void*" in the prototype instead. This 107. * gives us minimal prototype checking but avoids the compiler bugs. 108. * 109. * OBJ_P and MONST_P should _only_ be used for declaring function pointers. 110. */ 111. #define OBJ_P void* 112. #define MONST_P void* 113. #else 114. #define OBJ_P struct obj* 115. #define MONST_P struct monst* 116. #endif 117. 118. #define SIZE(x) (int)(sizeof(x) / sizeof(x0)) 119. 120. typedef int winid; /* a window identifier */ 121. 122. /* A limit for some NetHack int variables. It need not, and for comparable 123. * scoring should not, depend on the actual limit on integers for a 124. * particular machine, although it is set to the minimum required maximum 125. * signed integer for C (2^15 -1). 126. */ 127. #define LARGEST_INT 32767 128. 129. 130. #ifdef REDO 131. #define Getchar pgetchar 132. #endif 133. 134. /* 135. * Automatic inclusions for the subsidiary files. 136. * Please don't change the order. It does matter. 137. */ 138. 139. #ifndef COORD_H 140. #include "coord.h" 141. #endif 142. 143. #if defined(VMS) && !defined(VMSCONF_H) 144. # include "vmsconf.h" 145. #endif 146. 147. #if defined(UNIX) && !defined(UNIXCONF_H) 148. # include "unixconf.h" 149. #endif 150. 151. #if defined(OS2) && !defined(OS2CONF_H) 152. # include "os2conf.h" 153. #endif 154. 155. #if defined(MSDOS) && !defined(PCCONF_H) 156. # include "pcconf.h" 157. #endif 158. 159. #if defined(TOS) && !defined(TOSCONF_H) 160. # include "tosconf.h" 161. #endif 162. 163. #if defined(AMIGA) && !defined(AMICONF_H) 164. # include "amiconf.h" 165. #endif 166. 167. #if defined(MAC) && ! defined(MACCONF_H) 168. # include "macconf.h" 169. #endif 170. 171. /* Displayable name of this port; don't redefine if defined in *conf.h */ 172. #ifndef PORT_ID 173. # ifdef AMIGA 174. # define PORT_ID "Amiga" 175. # endif 176. # ifdef MAC 177. # define PORT_ID "Mac" 178. # endif 179. # ifdef MSDOS 180. # define PORT_ID "PC" 181. # endif 182. # ifdef OS2 183. # define PORT_ID "OS/2" 184. # endif 185. # ifdef TOS 186. # define PORT_ID "ST" 187. # endif 188. # ifdef UNIX 189. # define PORT_ID "Unix" 190. # endif 191. # ifdef VMS 192. # define PORT_ID "VMS" 193. # endif 194. #endif 195. 196. /* 197. * Configurable internal parameters. 198. * 199. * Please be very careful if you are going to change one of these. Any 200. * changes in these parameters, unless properly done, can render the 201. * executable inoperative. 202. */ 203. 204. /* size of terminal screen is (at least) (ROWNO+3) by COLNO */ 205. #define COLNO 80 206. #define ROWNO 21 207. 208. #define MAXNROFROOMS 20 /* max number of rooms per level */ 209. #define MAX_SUBROOMS 16 /* max # of subrooms in a given room */ 210. #define DOORMAX 120 /* max number of doors per level */ 211. 212. #define BUFSZ 256 /* for getlin buffers */ 213. #define QBUFSZ 128 /* for building question text */ 214. 215. #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */ 216. #define PL_CSIZ 20 /* sizeof pl_character */ 217. #define PL_FSIZ 32 /* fruit name */ 218. 219. #define MAXDUNGEON 10 /* current maximum number of dungeons */ 220. #define MAXLEVEL 30 /* max number of levels in one dungeon */ 221. #define MAXSTAIRS 1 /* max # of special stairways in a dungeon */ 222. #define ALIGNWEIGHT 4 /* generation weight of alignment */ 223. 224. #define MAXULEV 30 /* max character experience level */ 225. 226. #define MAXMONNO 120 /* geno monst after this number killed */ 227. #define MHPMAX 500 /* maximum monster hp */ 228. 229. #endif /* GLOBAL_H */ global.h